<template>
    <img :src="mainMerchant.backImg" alt="">
    <div class="header">
        <div class="kongBai"></div>
        <div class="merchantMessage">
            <p class="merchantName">{{mainMerchant.name}}</p>
            <img :src="mainMerchant.merchantLogo" alt="">
            <p class="pingFen">{{mainMerchant.assessScore===0?"暂无评分":"★"+mainMerchant.assessScore+"分"}}</p>
            <p class="yueShou">月售
                {{mainMerchant.monthSale<=100?mainMerchant.monthSale:
                String(mainMerchant.monthSale).split("").fill(0,1).join("")+"+"
                }}
            </p>
            <p class="peiShi">
                配送时间{{mainMerchant.peiSongTime<=60?mainMerchant.peiSongTime+"分":~~(mainMerchant.peiSongTime/60)+"时"+mainMerchant.peiSongTime%60+"分"}}
            </p>

        </div>
    </div>
</template>

<script>
    export default {
        name: "MerchantHeader",
        props:["mainMerchant"],
        data(){
            return {
            }
        }


    }
</script>

<style scoped>
    .header {
        width: 100vw;
    }
    .merchantMessage{
        width: 100vw;
        height: 100px;
        background: #fff;
        border-radius: 10px;
    }
    .merchantMessage img{
        width: 60px;
        height: 60px;
        position: absolute;
        right: 15px;
        z-index: 1;
        margin-top: 100px;
        border: 1px solid #fff;
        border-radius: 10px;
    }
    .kongBai{
        width: 100vw;
        height: 100px;
    }
    p{
        margin: 0;
        padding: 0;

    }
    img {
        width: 100%;
        height: 15%;
        margin: 0;
        padding: 0;
        position: fixed;
        top: 0;
        z-index: -1;
    }
    .merchantName{
        font-size: 20px;
        font-weight: 800;
        margin:10px 0 0 10px;
    }
    .pingFen{
        font-size: 12px;
        color: #ff7700;
        display: inline-block;
        margin:0 10px 0 ;
    }
    .yueShou{
        font-size: 12px;
        color: #aca9a9;
        display: inline-block;
        margin-right: 10px;

    }
    .peiShi{
        font-size: 12px;
        color: #aca9a9;
        display: inline-block;
    }
</style>